package com.von.util;

import cn.hutool.core.lang.UUID;

/**
 * @author xiaosai
 * @version 1.0
 * @date 2021/6/17 17:19
 * @describe
 * @className
 */
public class TokenUtils {
    //token前缀
    public static final String TOKEN_PREFIX = "Tk-";

    public static String build(Integer id){
        StringBuilder sb = new StringBuilder();
        sb.append(TOKEN_PREFIX);
        sb.append(id);
        sb.append("-");
        sb.append(UUID.fastUUID().toString().replaceAll("-",""));
        return sb.toString();
    }

    public static void main(String[] args) {
        System.out.println(TokenUtils.build(1));
    }
}
